package com.sxj.corejava.code08_常用类.其他类;

import java.util.Random;

/**
 * @author 石小俊
 */
public class Test02_Random {

    public static void main(String[] args) {
        Random random = new Random();
        System.out.println(random.nextInt());
        System.out.println(random.nextDouble());
        System.out.println(random.nextBoolean());
        // [0,10)
        System.out.println(random.nextInt(10));
        // [5,8]-->[0,3]+5-->[0,4)+5
        // x-y:random.nextInt(y-x+1)+x
        System.out.println(random.nextInt(4) + 5);
    }

}
